package aom.ju.ss.view.dicker

import android.os.Bundle
import aom.ju.ss.R
import aom.ju.ss.databinding.BannerItem140dpBinding
import aom.ju.ss.utils.VG
import aom.ju.ss.view.base.BaseFragment
import com.bumptech.glide.Glide
import java.util.concurrent.atomic.DoubleAdder

/**
 * 首页 易货 banner fragment
 */
class banner140Item : BaseFragment() {
    companion object {
        fun getMys(img: String): banner140Item {
            val f = banner140Item()
            val b = Bundle()
            b.putString("img", img)
            f.arguments = b
            return f
        }

        fun getMys(img: String,adder: String,loc:Any): banner140Item {
            val f = banner140Item()
            val b = Bundle()
            b.putString("img", img)
            b.putString("adder", adder)
            b.putString("loc", loc.toString())
            f.arguments = b
            return f
        }
    }

    private lateinit var binding: BannerItem140dpBinding
    override fun init() {
        binding = viewBinding as BannerItem140dpBinding

        if (requireArguments()["adder"]!=null){
            binding.address.VG(true)
            binding.jl.VG(true)
        }
        Glide.with(activity)
            .load(requireArguments()["img"])
            .centerCrop()
            .into(binding.img)
    }

    override fun getLay(): Int {
        return R.layout.banner_item_140dp
    }
}